package org.apache.james.mime4j.field;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.james.mime4j.field.address.AddressList;
import org.apache.james.mime4j.field.address.parser.ParseException;

public class AddressListField extends Field
{
  static Class class$org$apache$james$mime4j$field$AddressListField$Parser;
  private AddressList addressList;
  private ParseException parseException;

  protected AddressListField(String paramString1, String paramString2, String paramString3, AddressList paramAddressList, ParseException paramParseException)
  {
    super(paramString1, paramString2, paramString3);
    this.addressList = paramAddressList;
    this.parseException = paramParseException;
  }

  static Class class$(String paramString)
  {
    Class localClass;
    try
    {
      localClass = Class.forName(paramString);
      return localClass;
    }
    catch (ClassNotFoundException localClassNotFoundException)
    {
      throw new NoClassDefFoundError().initCause(localClassNotFoundException);
    }
  }

  public AddressList getAddressList()
  {
    return this.addressList;
  }

  public ParseException getParseException()
  {
    return this.parseException;
  }

  public static class Parser
  implements FieldParser
  {
    private static Log log;

    static
    {
      Class localClass;
      if (AddressListField.class$org$apache$james$mime4j$field$AddressListField$Parser == null)
      {
        localClass = AddressListField.class$("org.apache.james.mime4j.field.AddressListField$Parser");
        AddressListField.class$org$apache$james$mime4j$field$AddressListField$Parser = localClass;
      }
      while (true)
      {
        log = LogFactory.getLog(localClass);
        return;
        localClass = AddressListField.class$org$apache$james$mime4j$field$AddressListField$Parser;
      }
    }

    public Field parse(String paramString1, String paramString2, String paramString3)
    {
      Object localObject1 = null;
      Object localObject2 = null;
      try
      {
        AddressList localAddressList = AddressList.parse(paramString2);
        localObject1 = localAddressList;
        return new AddressListField(paramString1, paramString2, paramString3, localObject1, (ParseException)localObject2);
      }
      catch (ParseException localParseException)
      {
        if (log.isDebugEnabled())
          log.debug("Parsing value '" + paramString2 + "': " + localParseException.getMessage());
        localObject2 = localParseException;
      }
    }
  }
}